package main

import "fmt"

func main() {
	for {
		fmt.Println("请输入年月用空格隔开")
		var y, m int
		var isRun, isFinish bool = false, false
		var day31 = [...]int{1,3,5,7,8,10,12}
		var day30 = [...]int{4,6,9}
		var yDays int = 365
		var mDays int
		yearToDays = map[int](int){1:365}
		mouthToDays = map[int](int){1:31,2:28,3:31}

		fmt.Scan(&y, &m)
		if m > 12 || m < 1 {
			fmt.Println("请输入正确的月份")
			continue
		} else {
			if (y % 4 == 0 && y % 100 != 0) || (y % 400 == 0) {
				isRun = true
			}
		}

		if isRun {
			yDays = 366
		}
		for _,m31 := range day31 {
			if m == m31 {
				isFinish = true
				mDays = 31
			}
		}
		if !isFinish {
			for _,m30 := range day30 {
				if m == m30 {
					isFinish = true
					mDays = 30
				}
			}
		}

		if !isFinish {
			if isRun {
				mDays = 29
			} else {
				mDays = 28
			}
			isFinish = true
		}

		fmt.Printf("%d年有%d天,%d月有%d天\n", y, yDays, m, mDays)

	}
}
